package com.xy.job.admin.common.config

import org.springframework.boot.task.ThreadPoolTaskSchedulerBuilder
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler

@Configuration
class ExecutorConfig {

    @Bean
    fun registerExecutor(): ThreadPoolTaskScheduler {
        return ThreadPoolTaskSchedulerBuilder()
            .threadNamePrefix("node-register-executor-")
            .poolSize(2)
            .awaitTermination(false)
            .build()
    }
}